<?php
require_once('common.php');
//************************执行代码开始*************************

if($do=$_POST['do']){
	foreach($_POST as $k=> $value){
		if(safestr($k)=='web_separate_gg' && $isdomain){
		exit("<script language='javascript'>alert('保存失败！您不能修改分站公告');window.location.href='set.php';</script>");
		}
		$db->query("insert into {$prefix}webconfigs set vkey='".safestr($k)."',value='".safestr($value)."' on duplicate key update value='".safestr($value)."'");
	}
	if($rows=$db->get_results("select * from {$prefix}webconfigs")){
		foreach($rows as $row){
			$webconfig[$row['vkey']]=$row['value'];
		}
		C($webconfig);
	}

	echo"<script language='javascript'>alert('保存成功！');window.location.href='set.php';</script>";
}

//**************************执行代码开始*******************************
C('pageid','adminset');
include_once 'common.head.php';
?>
		<div class="wrapper wrapper-content animated fadeInRight">
              <!-- page start--><!-- 网站设置 -->
                      <div class="row">
					  
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>基本设置 </h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
							<form action="?xz=set" class="form-horizontal tasi-form" method="post">
								<input type="hidden" name="do" value="set">
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">网站名称</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="webname" value="<?=C('webname')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">网站介绍</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="webkey" value="<?=C('webkey')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">网站域名</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="webdomain" value="<?php
										if(!C('webdomain')){
										echo $_SERVER['HTTP_HOST'];
										}
										?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">站长QQ</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="webqq" value="<?=C('webqq')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">用户交流群</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="webgroup" value="<?=C('webgroup')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">注册默认配额</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="regpeie" value="<?=C('regpeie')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">注册赠送余额</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="regrmb" value="<?=C('regrmb')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">秒赞服务器数量</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="zannet" value="<?=C('zannet')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">说说服务器数量</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="shuonet" value="<?=C('shuonet')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">代理提卡价格便宜</label>
									<div class="col-sm-9">
										 <div class="input-group m-b">
                                        <input type="text" class="form-control" name="dailikm" value="<?=C('dailikm')?>"><span class="input-group-addon">%</span>
                                </div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">每个服务器最多QQ数</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="netnum" value="<?=C('netnum')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">QQ添加/更新提醒</label>
									<div class="col-sm-9 checkbox i-checks">
										<p>
											<label class="radio-inline">
												<input type="radio" name="webqqtx" value="0" checked=""> <i></i> 关闭
											</label>
											<label class="radio-inline">
												<input type="radio" name="webqqtx" value="1" <?php if(C('webqqtx')==1) echo 'checked=""';?>>
												<font color="green"> <i></i> 开启</font>
											</label>
										</p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">用户中心首页界面</label>
									<div class="col-sm-9 checkbox i-checks">
										<p>
											<label class="radio-inline">
												<input type="radio" name="usertype" value="0" checked=""> <i></i> V2界面
											</label>
											<label class="radio-inline">
												<input type="radio" name="usertype" value="1" <?php if(C('usertype')==1) echo 'checked=""';?>>
												<font color="green"> <i></i> V1界面</font>
											</label>
										</p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">腾讯反检测系统</label>
									<div class="col-sm-9 checkbox i-checks">
										<p>
											<label class="radio-inline">
												<input type="radio" name="txprotect" value="0" checked=""> <i></i> 关闭
											</label>
											<label class="radio-inline">
												<input type="radio" name="txprotect" value="1" <?php if(C('txprotect')==1) echo 'checked=""';?>>
												<font color="green"> <i></i> 开启</font>
											</label>
										</p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">不是VIP也可以使用所有功能</label>
									<div class="col-sm-9 checkbox i-checks">
										<p>
											<label class="radio-inline">
												<input type="radio" name="webfree" value="0" checked=""> <i></i> No
											</label>
											<label class="radio-inline">
												<input type="radio" name="webfree" value="1" <?php if(C('webfree')==1) echo 'checked=""';?>>
												<font color="green"> <i></i> Yes</font>
											</label>
										</p>
										<p>(所有功能除自动说说与秒赞外)</p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">监控识别码</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="cronrand" value="<?=C('cronrand')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">代挂对接</label>
									<div class="col-sm-9 checkbox i-checks">
										<p>
											<label class="radio-inline">
												<input type="radio" name="dgapi" value="1" <?php if(C('dgapi')==1) echo 'checked=""';?>> <i></i> <font color="green"> <i></i> 我爱代挂</font>
											</label>
											<label class="radio-inline">
												<input type="radio" name="dgapi" value="2" <?php if(C(dgapi)==2) echo 'checked=""';?>>
												<font color="green"> <i></i> Q族代挂</font>
											</label>
											<label class="radio-inline">
												<input type="radio" name="dgapi" value="3" <?php if(C('dgapi')==3) echo 'checked=""';?>>
												<font color="green"> <i></i> 新领域代挂</font>
											</label>
											<label class="radio-inline">
												<input type="radio" name="dgapi" value="0" <?php if(C('dgapi')==0) echo 'checked=""';?>>
												<font color="green"> <i></i> 自定义代挂</font>
											</label>
										</p>
										<p>(自定义代挂在下面填写接口)</p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">代挂api地址</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="dgapi" value="<?=C('dgapi')?>">
									</div>
								</div>
								<div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" type="submit">保存内容</button>
                                    <button class="btn btn-white" type="submit">取消</button>
                                </div>
                            </div>
							</form>
						</div>
					</div>
				<div class="col-lg-12">
                      <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>公告设置 </h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
							<form action="?xz=gg" class="form-horizontal tasi-form" method="post">
								<input type="hidden" name="do" value="gg">
								<?php if($isdomain){}else{?>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">分站用户中心公告</label>
									<div class="col-sm-9">
										<textarea class="form-control" name="web_separate_gg" rows="5"><?=stripslashes(C('web_separate_gg'))?></textarea>
									</div>
								</div>
								<?php } ?>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">用户中心公告</label>
									<div class="col-sm-9">
										<textarea class="form-control" name="web_control_gg" rows="5"><?=stripslashes(C('web_control_gg'))?></textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">购买页说明</label>
									<div class="col-sm-9">
										<textarea class="form-control" name="web_shop_gg" rows="5"><?=stripslashes(C('web_shop_gg'))?></textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">充值页公告(用于展示购买卡密地址)</label>
									<div class="col-sm-9">
										<textarea class="form-control" name="web_rmb_gg" rows="5"><?=stripslashes(C('web_rmb_gg'))?></textarea>
									</div>
								</div>
								<div class="form-group">
								<div class="col-sm-12 col-sm-offset-10">
                                    <button class="btn btn-primary" type="submit">保存内容</button>
                                </div>
								</div>
							</form>
						</div>
					</div></div>
					<div class="col-lg-12">
                      <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>广告设定 </h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                          <div class="ibox-content">
							<form action="?xz=wb" class="form-horizontal tasi-form" method="post">
								<input type="hidden" name="do" value="wb">
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">免费用户说说尾巴广告</label>
									<div class="col-sm-9">
										<textarea class="form-control" name="shuogg" rows="5"><?=stripslashes(C('shuogg'))?></textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">每日签到广告内容</label>
									<div class="col-sm-9">
										<textarea class="form-control" name="qdgg" rows="5"><?=stripslashes(C('qdgg'))?></textarea>
									</div>
								</div>
								<div class="form-group">
								<div class="col-sm-12 col-sm-offset-10">
                                    <button class="btn btn-primary" type="submit">保存内容</button>
                                </div>
								</div>
							</form>
						</div>
					</div></div></div>
			<div class="col-lg-12">
                      <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>用户购卡价格设定 </h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                          <div class="ibox-content">
							<form action="?xz=price" class="form-horizontal" method="post">
								<input type="hidden" name="do" value="pricet">
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">1天VIP</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_1dvip" value="<?=C('price_1dvip')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">1月VIP</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_1vip" value="<?=C('price_1vip')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">3月VIP</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_3vip" value="<?=C('price_3vip')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">6月VIP</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_6vip" value="<?=C('price_6vip')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">12月VIP</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_12vip" value="<?=C('price_12vip')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">1个配额</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_1peie" value="<?=C('price_1peie')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">3个配额</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_3peie" value="<?=C('price_3peie')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">5个配额</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_5peie" value="<?=C('price_5peie')?>">
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">10个配额</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="price_10peie" value="<?=C('price_10peie')?>">
									</div>
								</div>
								<div class="form-group">
								<div class="col-sm-12 col-sm-offset-10">
                                    <button class="btn btn-primary" type="submit">保存设置</button>
                                </div>
								</div>
							</form>
						</div>
					</div></div>
					
				
				<div class="col-lg-12">
                      <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>圈圈接口设置 </h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                          <div class="ibox-content">
							<form action="?xz=quanquan" class="form-horizontal" method="post">
								<input type="hidden" name="do" value="quanquan">
								<div class="form-group">
									<label class="col-lg-2 control-label" for="field-2">圈圈接口：</label>
									<div class="col-sm-9">
										<input class="form-control" type="text" name="web_quanquanjk" value="<?=C('web_quanquanjk')?>">
									</div>
								</div>
								<div class="form-group">
								<div class="col-sm-12 col-sm-offset-10">
                                    <button class="btn btn-primary" type="submit">保存设置</button>
                                </div>
								</div>
							</form>
						</div></div>
				</div>
</div></div></div>
	  <?php
include_once 'common.foot.php';
?>